#ifndef H_RCGD_EB_H
#define H_RCGD_EB_H

#define PRIMARY_RECEIVER 	0
#define SECONDARY_RECEIVER 	1


#define POSITION_MODE_AVERAGING	0
#define POSITION_MODE_KNOWN		1
#define POSITION_MODE_DYNAMIC	2



#define     SET_START               0
#define		SET_LOG					8
#define     SET_GmtOffset           1
#define     SET_Antdly              2
#define		SET_TRAIM				22
#define     SET_Position            3
#define     SET_TOD                 9
#define     SET_ALMANAC             5
#define     SET_GetLeapSecond       6
#define     SET_GetModuleID         7
#define		SET_TimeMode			11
#define		SET_StartLog			12

#define		SET_SATSTATUS			13

#define 	SET_Delay				14

#define		SET_MASK				15

#define		EB_STATUS_NONE			0
#define		EB_STATUS_SELFTEST		1
#define		EB_STATUS_ALMANAC		2
#define		EB_STATUS_SET			3
#define		EB_STATUS_RUN			4

/* Set almanac step */
#define     EB_SET_PSDM             0
#define		EB_SET_EB_ID			1
#define		EB_SET_ALMANAC			2
#define 	EB_SET_LEAPSECOND		3


/* Leap Second step */
#define     SetTimeToGPS            0
#define     StartGPSTime            1
#define     SetTimeToUTC            2
#define     StartUTCTime            3
#define     FinalGPSTime            4

#define		INIT_EB_LOUD		0
#define		INIT_EB_SILENT		1

#define		INIT_EB_FIRST		0
#define		INIT_EB_SECOND		1
#define		INIT_EB_NOT_RESET	2

#define		EB_STATUS_8K_RUN			5


extern void Init_EB(char mode, char times, char no_alarm);
extern void Init_EB2(char mode, char times, char no_alarm);
extern int init_eb_timeout;
extern unsigned char tod_status;
extern int fdEB;
extern int fdEB2;

void EB_Task_start();
void EB_Task();

#endif
